
enum SIZE {
    //% block="29*29"
    1,
    //% block="58*58"
    2
}

enum LINE {
    //% block="1"
    1,
    //% block="2"
    2,
    //% block="3"
    3,
    //% block="4"
    4
}

enum BTN {
    //% block="A"
    A,
    //% block="B"
    B,
    //% block="A+B"
    AB
}


//% color="#3f48cc" iconWidth=35 iconHeight=35
namespace flexitimer2 {
    //% block="计时器中断 间隔（ms）[TIME]" blockType="hat"
    //% TIME.shadow="number" TIME.defl="10"
    export function buttonPress(parameter: any, block: any) {
        let time = parameter.TIME.code
        Generator.addInclude('flexitimer2', '#include <FlexiTimer2.h>');
        Generator.addSetup(`FlexiTimer2::set`, `FlexiTimer2::set(${time},time_int);`);
        Generator.addSetup(`FlexiTimer2::start`, `FlexiTimer2::start();`);
        Generator.addEvent("time_int", "void", "time_int", "", true);
    }

}
